package com.ruoyi.easyfame.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.easyfame.mapper.TbOrderformMapper;
import com.ruoyi.easyfame.domain.TbOrderform;
import com.ruoyi.easyfame.service.ITbOrderformService;

/**
 * 订单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-18
 */
@Service
public class TbOrderformServiceImpl implements ITbOrderformService 
{
    @Autowired
    private TbOrderformMapper tbOrderformMapper;

    /**
     * 查询订单信息
     * 
     * @param id 订单信息主键
     * @return 订单信息
     */
    @Override
    public TbOrderform selectTbOrderformById(Long id)
    {
        return tbOrderformMapper.selectTbOrderformById(id);
    }

    /**
     * 查询订单信息列表
     * 
     * @param tbOrderform 订单信息
     * @return 订单信息
     */
    @Override
    public List<TbOrderform> selectTbOrderformList(TbOrderform tbOrderform)
    {
        return tbOrderformMapper.selectTbOrderformList(tbOrderform);
    }

    /**
     * 新增订单信息
     * 
     * @param tbOrderform 订单信息
     * @return 结果
     */
    @Override
    public int insertTbOrderform(TbOrderform tbOrderform)
    {
        tbOrderform.setCreateTime(DateUtils.getNowDate());
        return tbOrderformMapper.insertTbOrderform(tbOrderform);
    }

    /**
     * 修改订单信息
     * 
     * @param tbOrderform 订单信息
     * @return 结果
     */
    @Override
    public int updateTbOrderform(TbOrderform tbOrderform)
    {
        tbOrderform.setUpdateTime(DateUtils.getNowDate());
        return tbOrderformMapper.updateTbOrderform(tbOrderform);
    }

    /**
     * 批量删除订单信息
     * 
     * @param ids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderformByIds(Long[] ids)
    {
        return tbOrderformMapper.deleteTbOrderformByIds(ids);
    }

    /**
     * 删除订单信息信息
     * 
     * @param id 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderformById(Long id)
    {
        return tbOrderformMapper.deleteTbOrderformById(id);
    }
}
